<template>
  <work-template v-loading="loading" v-model="ruleForm"
                 @closeSelectedTag="closeSelectedTag" :butShow="false">
    <div slot="form" class="container-div">
      <!--   申请信息   -->
      <new-application-info state="readonly" v-model="ruleForm" :status="22"
                            @successList="successList" :buttonBoolean="true"/>
      <!--   处置记录   -->
      <disposalRecord v-model="ruleForm"/>
      <!--  过户信息  手续信息  -->
      <documentMessage v-model="ruleForm"/>
      <!--  残值记录  撤销处置记录 操作记录  -->
      <tabulationRecords v-model="ruleForm"/>
    </div>

  </work-template>
</template>

<script>
import * as apis from '@/api/vehicleDisposal/routineHandle.js'

export default {
  name: 'RoutineHandleDetails',
  components: {
    newApplicationInfo: () => import("../../components/routineDisposal/routineApplyFor/newApplicationInfo.vue"),
    disposalRecord: () => import("../../components/routineDisposal/routineHandle/disposalRecord.vue"),
    documentMessage: () => import("../../components/routineDisposal/routineHandle/documentMessage.vue"),
    tabulationRecords: () => import("../../components/routineDisposal/routineHandle/tabulationRecords.vue"),
  },
  computed: {},
  watch: {},
  data() {
    return {
      ruleForm: {},
      loading: false
    };
  },
  created() {
    this.handleDetails()
  },
  mounted() {
  },
  methods: {
    async handleDetails() {
      this.loading = true
      try {
        let obj = {
          vehicleDisposalNo: this.$route.query.id
        }
        const res = await apis.getInfo(obj)
        this.ruleForm = res.data || {}
      } catch (e) {
        console.error(e)
      } finally {
        this.loading = false
      }
    },

    closeSelectedTag(view) {
      this.$tab.closePage(view).then(({visitedViews}) => {
        this.$router.push({
          path: `/VehicleDisposal/RoutineDisposal/${this.$route.query.path}`,
        });
      });
    },

    successList() {
      this.handleDetails()
    }
  },
};
</script>

<style scoped lang=""></style>


